package com.speciality.demo.demos.web;

import com.speciality.demo.demos.dto.TravelAdviceDTO;
import com.speciality.demo.demos.result.Result;
import com.speciality.demo.demos.service.TravelAdviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping("/api/travel")
public class TravelAdviceController {
    @Resource
    private TravelAdviceService travelAdviceService;

    @GetMapping("/advice")
    public Result<TravelAdviceDTO> advice() throws IOException {
        TravelAdviceDTO harbinFormalAdvice = travelAdviceService.getHarbinFormalAdvice();
        return Result.ok(harbinFormalAdvice);
    }
}
